<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="https://cdn.bootcss.com/bootstrap/4.0.0-beta/css/bootstrap-grid.min.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/TableExport/5.0.0-rc.11/css/tableexport.min.css" rel="stylesheet">
    <title>tableexport 导出</title>
</head>
<body>
<div>
    <!--<button class="btn btn-primary" onClick="$('#stats_datatable').tableExport({type:'csv',escape:'false',filename:'(2016-02-29_2016-03-06)'});">CSV</button>-->
    <!--<button class="btn btn-primary" onClick="$('#stats_datatable').tableExport({type:'txt',escape:'false',filename:'(2016-02-29_2016-03-06)'});">TXT</button>-->
    <!--<button class="btn btn-primary" id="excel" >Excel</button>-->
    <!--<button class="btn btn-primary" onClick="$('#stats_datatable').tableExport({type:'doc',escape:'false',filename:'(2016-02-29_2016-03-06)'});">Word</button>-->
    <!--<button class="btn btn-primary" onClick="$('#stats_datatable').tableExport({type:'png',escape:'false',filename:'(2016-02-29_2016-03-06)'});">PNG</button>-->
</div>
 <br/>
<div class="panel-body">
	
	<table id="data-table" class="table datatable">
		<thead>
			<td>名称</td>
			<td>里程</td>
			<td>次数</td>
			<td>天数</td>
			<td>签到</td>
			<td>活动</td>
			<td>时间周期</td>
			<td>更新时间</td>
		</thead>
		<tbody>
		</tbody>
	</table>
</div>
<!-- START SCRIPTS -->
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<!-- XLSX (Excel 2007+ XML Format) -->
<script src="https://cdn.bootcss.com/xlsx/0.11.5/xlsx.core.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/blob-polyfill/1.0.20150320/Blob.js" ></script>
<script src="https://cdn.bootcss.com/FileSaver.js/2014-11-29/FileSaver.min.js"></script>
<!--<script src="https://cdn.bootcss.com/TableExport/5.0.0-rc.11/js/tableexport.js"></script>-->
<script type="text/javascript" src="static/js/tableexport.js" ></script>

<!-- PDF 
<script src="https://cdn.bootcss.com/jspdf/1.3.5/jspdf.min.js"></script>
<script src="https://cdn.bootcss.com/jspdf-autotable/2.3.2/jspdf.plugin.autotable.js"></script>
-->

<script>
	$(function() {
		/**
		 *动态赋值 
		 */
		for(var i=1;i <= 10;i++){
			var html = '';
			html += '<tr>'+
						'<td>'+i+'</td>'+
						'<td>'+i+'</td>'+
						'<td>'+i+'</td>'+
						'<td>'+i+'</td>'+
						'<td>'+i+'</td>'+
						'<td>'+i+'</td>'+
						'<td>'+i+'</td>'+
						'<td>'+(new Date()).toLocaleString()+'</td>'+
					'</tr>';
			$('tbody').append(html);
		}
		
		/**
		 * 表格初始化
		 */
		$("table").tableExport({
			headers: true,				
			footers: true,           
			formats: ["xlsx"],
			filename: "filename",
			bootstrap: true,
			exportButtons: true,
			position: "bottom",
			ignoreRows: null,
			ignoreCols: null,
			trimWhitespace: true
		});
});
</script>
</body>
</html>